package db

const TableNameTypeCard = TablePrefix + "type_card"

type TypeCard struct {
	BaseModel
	TypeID          uint  `gorm:"column:type_id;type:int(11);default:0;comment:商品id" json:"type_id" form:"type_id"`                               //商品id
	UpgradeCardNum  int64 `gorm:"column:upgrade_card_num;type:int(11);default:0;comment:升级所需数量" json:"upgradeCardNum" form:"upgradeCardNum"`      //升级所需数量
	Level           int64 `gorm:"column:level;type:int(11);default:0;comment:等级" json:"level" form:"level"`                                       //等级
	ConsumeTypeID   uint  `gorm:"column:consume_type_id;type:int(11);default:0;comment:消耗类型id" json:"consumeTypeID" form:"consumeTypeID"`         //消耗类型id
	ConsumeNum      int64 `gorm:"column:consume_num;type:bigint(20);default:0;comment:消耗数量" json:"consumeNum" form:"consumeNum"`                  //消耗数量
	Donation        int64 `gorm:"column:donation;type:int(11);default:0;comment:赠送产值" json:"donation" form:"donation"`                            //赠送产值
	TotalOutput     int64 `gorm:"column:total_output;type:bigint(20);default:0;comment:总产值" json:"totalOutput" form:"totalOutput"`                //总产值
	OutputTypeID    uint  `gorm:"column:output_type_id;type:int(11);default:0;comment:产出类型id" json:"outputTypeID" form:"outputTypeID"`            //产出类型id
	Output          int64 `gorm:"column:output;type:bigint(20);default:0;comment:每日产出" json:"output" form:"output"`                               //每日产出
	OutputMax       int64 `gorm:"column:output_max;type:bigint(20);default:0;comment:最大每日产出" json:"outputMax" form:"outputMax"`                   //最大每日产出
	Rate            int64 `gorm:"column:rate;type:int(11);default:0;comment:抽取概率" json:"rate" form:"rate"`                                        //抽取概率
	RateMax         int64 `gorm:"column:rate_max;type:int(11);default:0;comment:抽取最大" json:"rateMax" form:"rateMax"`                              //抽取最大
	IntegralRate    int64 `gorm:"column:integral_rate;type:int(11);default:0;comment:积分抽取概率" json:"integralRate" form:"integralRate"`             //积分抽取概率
	IntegralRateMax int64 `gorm:"column:integral_rate_max;type:int(11);default:0;comment:积分抽取概率最大" json:"integralRateMax" form:"integralRateMax"` //积分抽取概率最大
	IsIni           bool  `gorm:"column:is_ini;type:int(11);default:0;comment:是否可抽取" json:"isTni" form:"isIni"`                                   //是否可抽取
}

func (*TypeCard) TableName() string {
	return TableNameTypeCard
}

type TypeCardHaseOneType struct {
	TypeCard
	ConsumeType Type `gorm:"foreignKey:ID;references:ConsumeTypeID" json:"consumeType"`
	OutputType  Type `gorm:"foreignKey:ID;references:OutputTypeID" json:"outputType"`
}
